package com.zhuiyun.project.api.ancientPoetry.service;

import com.zhuiyun.project.api.ancientPoetry.model.AncientPoetryModel;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.pageUtil.PageRequest;

import java.io.IOException;

public interface AncientPoetryService {
    /**
     *
     * @Author shy
     * @Date 2023/12/7 11:47
      * @param ancientPoetryModel
     * @return CommonResult
     */
    CommonResult PageListPoetry(AncientPoetryModel ancientPoetryModel, PageRequest pageRequest);

    /**
     *
     * @Author shy
     * @Date 2023/12/7 15:31 TODO 本地添加诗
     * @param path   本地文本存储的地址
     * 文本样式：Json类型
     *   最后一个文本必须要少一括号
     *   例：[{"author": "","paragraphs": "","title": ""},{},{]
     *
     */
    void URLInsert(String path) throws IOException;

    /**
     *
     * @Author shy
     * @Date 2023/12/7 15:44 TODO 根据id删除诗词
     * @param id
     * @return CommonResult
     */
    CommonResult DeletePoetry(Integer id);

    /**
     *
     * @Author shy TODO 添加诗词
     * @Date 2023/12/8 11:05
      * @param ancientPoetryModel
     * @return CommonResult
     */
    CommonResult insertPoetry(AncientPoetryModel ancientPoetryModel) throws CommonException;

    /**
     *
     * @Author shy
     * @Date 2023/12/14 10:50 TODO 修改诗词
     * @param ancientPoetryModel
     * @return CommonResult
     */
    CommonResult updatePoetry(AncientPoetryModel ancientPoetryModel) throws CommonException;
}
